#include "../myudp.h"

#define UDP_SERVER_IP   "192.168.31.13"
#define UDP_SERVER_PORT 50000

#define UDP_SEND_FILE_NAME "sendtest.txt"

int main(int argc, char const *argv[])
{
    int Ret;
    
    int UdpClintSockFd;
    Ret = UdpSelfBind( &UdpClintSockFd, NULL, -1 );
    if( -1 == Ret )
    {
        perror( "fail UdpSelfBind" );
        return -1;
    }

    Ret = UdpSendFile( UdpClintSockFd, UDP_SEND_FILE_NAME, UDP_SERVER_IP, UDP_SERVER_PORT );
    if( -1 == Ret )
    {
        perror( "fail UdpSendFile" );
        return -1;
    }

    printf( "success UdpSendFile: %s to %s : %d\n", UDP_SEND_FILE_NAME, UDP_SERVER_IP, UDP_SERVER_PORT );

    Ret = close( UdpClintSockFd );
    if( -1 == Ret )
    {
        perror( "fail close" );
        return -1;
    }

    return 0;
}
